package com.bms.mapper;

import com.bms.common.response.ActivityResponse;
import com.bms.entity.Activity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ActivityMapper {
    /**
     * 根据类别id查询活动
     * @param categoryId 类别id
     * @param status 活动状态
     * @return 活动列表
     */
    List<Activity> selectByCategoryId(@Param("categoryId") String categoryId, @Param("status") int status);

    Integer getCount();

    Integer addActivity(Activity activity);

    int getSearchCount(Map<String, Object> params);

    List<ActivityResponse> searchActivitiesByPage(Map<String, Object> params);

    Integer updateActivity(Activity activity);

    Integer updateStatus(@Param("activityId") String activityId, @Param("status") int status);

    List<Activity> getActivitiesSelectList();

    void updateActivityStatus(Activity activity);

    Activity selectByActivityId(String activityId);
}
